/**
 * Project: push-center-biz-core
 * 
 * File Created at 2014年10月9日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package com.greenline.push.core.pushcenter.impl;

import java.util.List;

import javax.annotation.Resource;

import com.greenline.push.core.pushcenter.MsgRetryManager;
import com.greenline.push.dal.pushcenter.MsgRetryDAO;
import com.greenline.push.dal.pushcenter.dataobject.MsgRetryDO;
import com.greenline.push.dal.query.MsgRetryQuery;

/**
 * @Type AppChannelManagerImpl
 * @Desc
 * @author zhaoli
 * @date 2014年10月9日
 * @Version V1.0
 */
public class MsgRetryManagerImpl implements MsgRetryManager {
    @Resource
    private MsgRetryDAO msgRetryDAO;

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.core.pushcenter.AppChannelManager#insert(com.greenline
     * .push.dal.pushcenter.dataobject.MsgRetryDO)
     */
    @Override
    public Long insert(MsgRetryDO appChannel) {
        return msgRetryDAO.insert(appChannel);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.core.pushcenter.AppChannelManager#getAppChannelById
     * (java.lang.Long)
     */
    @Override
    public MsgRetryDO getById(Long id) {
        return msgRetryDAO.getById(id);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.core.pushcenter.AppChannelManager#update(com.greenline
     * .push.dal.pushcenter.dataobject.MsgRetryDO)
     */
    @Override
    public boolean update(MsgRetryDO msgRetryDO) {
        return msgRetryDAO.update(msgRetryDO) > 0;
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.core.pushcenter.AppChannelManager#listByQuery(com.
     * greenline.push.dal.query.AppChannelQuery)
     */
    @Override
    public MsgRetryQuery listByQuery(MsgRetryQuery query) {
        return msgRetryDAO.listByQuery(query);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.greenline.push.core.pushcenter.AppChannelManager#listByQuery(java
     * .lang.Long)
     */
    @Override
    public boolean delete(Long id) {
        return msgRetryDAO.delete(id) > 0;
    }

    @Override
    public List<MsgRetryDO> listByExample(MsgRetryDO msgRetryDO) {
        return msgRetryDAO.listByExample(msgRetryDO);
    }

    @Override
    public List<MsgRetryDO> fetchMsgList(Long startId, Integer count, String appChannel) {
        return msgRetryDAO.fetchMsgList(startId, count, appChannel);
    }

    @Override
    public void updateAllSendStatus() {
        msgRetryDAO.updateAllSendStatus();
    }

}
